
# Forms:
set Child(form) { bin dim solute par pore jobs}

set Title(bin) "Binary Files"
set Title(dim) "Dimension"
set Title(solute) "Ions&Solutes"
set Title(par) "Parameters"
set Title(pore) "Pore"
set Title(jobs) "Josbs"
set Title(help) "Help"

# Form bin
set Child(bin) { mbuild apbs }

set Title(bin.mbuild) "Membrane Builder"
set Type(bin.mbuild) Group
set Title(bin.apbs) "APBS"
set Type(bin.apbs) Group

set Title(bin.mbuild.path) "Path: "
set Type(bin.mbuild.path) File
set bin_mbuild_path /home/yi/simulation/software/mbuilder/bin/mbuild
if ![catch { exec which mbuild } path] { set bin_mbuild_path $path }
set Title(bin.apbs.path) "Path: "
set Type(bin.apbs.path) File
set bin_apbs_path /home/yi/simulation/software/mbuilder/bin/apbs
if ![catch { exec which apbs } path] { set bin_apbs_path $path }
# Form Dimensrion
set Title(dim) "Dimension"
set Description(dim) "Dimension of membrane"

set Title(dim.focus) "Focusing Systems"
set Description(dim.focus) "Use the potential calculated from larger system as the boundary potential for the following system.\n Used to improve the estimation of boundary condition."
set Type(dim.focus) Group
set Title(dim.focus.systems) "Label  Size(X)  Size(Y)  Size(Z)  Nx  Ny  Nz "
set Type(dim.focus.systems) Table(label,x,y,z,nx,ny,nz)
set dim_focus_systems(rows) { H L M S X}
array set dim_focus_systems { 0,label H 0,x 640 0,y 640 0,z 640 0,nx 161 0,ny 161 0,nz 161 \
				  1,label L 1,x 480 1,y 480 1,z 480 1,nx 161 1,ny 161 1,nz 161 \
				  2,label M 2,x 240 2,y 240 2,z 240 2,nx 161 2,ny 161 2,nz 161 \
				  3,label S 3,x 120 3,y 120 3,z 120 3,nx 161 3,ny 161 3,nz 161 \
				  4,label X 4,x 80 4,y 80 4,z 80 4,nx 161 4,ny 161 4,nz 161

}
set Title(dim.memb) "Membrane Size"
set Type(dim.memb) Group
set Description(dim.memb) "The length of membrane in X,Y,Z axis)"
set Child(dim.memb) { {x  y  z} {x0  y0 z0}}
set Title(dim.memb.x) "X: "
set dim_memb_x 240
set Type(dim.memb.x) Entry
set Title(dim.memb.y) "Y: "
set dim_memb_y 240 
set Type(dim.memb.y) Entry
set Title(dim.memb.z) "Z: "
set Type(dim.memb.z) Entry
set dim_memb_z 240
set Type(dim.memb.x0) Entry
set Title(dim.memb.x0) "X0: "
set dim_memb_x0 0
set Type(dim.memb.y0) Entry
set Title(dim.memb.y0) "Y0: "
set dim_memb_y0 0
set Type(dim.memb.z0) Entry
set Title(dim.memb.z0) "Z0: "
set dim_memb_z0 0

#Form Parameters
set Child(par) { {charge - } { diel shape } {temperature - }}
set Title(par.temperature) "Temperature"
set Type(par.temperature) Entry
set par_temperature 298.5
set Title(par.diel) "Dielectric Constant"
set Type(par.diel) Group
set Title(par.diel.water) "Water: "
set Type(par.diel.water) Entry
set par_diel_water 80.0
set Title(par.diel.head) "Head Group: "
set Type(par.diel.head) Entry
set par_diel_head 10.0
set Title(par.diel.memb) "Membrane: "
set Type(par.diel.memb) Entry
set par_diel_memb 2.0
set Title(par.diel.solute) "Solute(protein): "
set Type(par.diel.solute) Entry
set par_diel_solute 2.0
set Title(par.shape) "Membrane Shape: "
set Type(par.shape) Group
set Title(par.shape.thick) "Hydrocarbon core thickness: "
set Type(par.shape.thick) Entry
set par_shape_thick  27
set Title(par.shape.width) "Headgroup region width: "
set Type(par.shape.width) Entry
set par_shape_width 3.0 
set Title(par.shape.boundary) "Ion Boundary Location: "
set Type(par.shape.boundary) Entry
set par_shape_boundary  3.0
set Title(par.shape.area) "Area per Lipid: "
set Type(par.shape.area) Entry
set par_shape_area 65.0
set Title(par.shape.excess) "Excess Charge: "
set Type(par.shape.excess) Entry
set par_shape_excess -1
set Title(par.charge) {"Multi-Layers" "Two-Layers" }
set Type(par.charge) Selection
set par_char "Charge separation"
set Child(par.charge) { layers { { w- w+ } {anfr -} {seps -} } }
set Title(par.charge.w-) "Width -:"
set Type(par.charge.w-) Entry
set par_charge_w- 0.75
set Title(par.charge.w+) "Width +:"
set Type(par.charge.w+) Entry
set par_charge_w+ 0.75
set Title(par.charge.seps) "Charge layer seperation:"
set Type(par.charge.seps) Entry
set Title(par.charge.anfr) "Anionic lipid fraction:"
set Type(par.charge.anfr) Entry
set Title(par.charge.layers) "label location {charge density} {gaussian width}"
set Type(par.charge.layers) Table(label,loc,density,width)
set par_charge_layers(rows) { - +}
array set par_charge_layers { 0,label - 0,loc 3.0 0,density {-1.0/65} 0,width 0.75 \
				  1,label + 1,loc 1.5 1,density {1.0/65} 1,width 0.75
}


#Form Solute
set Title(solute) "Ions&Solutes"
set Type(solute) Form
set Title(solute.protein) "Solute(peptide/protein/etc.): "
set Type(solute.protein) Group
set Title(solute.protein.pqr) "pqr file: "
set Type(solute.protein.pqr) File
set Description(solute.protein.pqr) "PQR file for protein/nucleic acid solute or explicit ions.\nNo solute(dummy solute actually, which has no charge and volume at all) will be used if no pqr file specified."
set solute_protein_pqr /home/yi/simulation/software/mbuilder/example/dummy.pqr
set Title(solute.ions) "Ions: "
set Description(solute.ions) "Set Up the implicit ions in the solution.\nWill be used to do PB calculation."
set Type(solute.ions) Group
set Title(solute.ions.conc) "Total Concentration: "
set Description(solute.ions.conc) "Total Concentration of all ions.\n Won\'t affect the PB calculation.\n Only meaningful for calculation using Gouy-Chapmann approximation."
set Type(solute.ions.conc) Entry
set solute_ions_conc 0.100
set Title(solute.ions.table) "Name Charge Concentration Radius"
set Type(solute.ions.table) Table(name,charge,conc,radius)
set solute_ions_table(rows) { Na Cl }
array set solute_ions_table { 0,name Na 0,charge 1 0,conc 0.100 0,radius 2.0 \
				  1,name Cl 1,charge -1 1,conc 0.100 1,radius 2.0
}


#Form Pore
set Title(pore.toroidal) "Toroidal Pore: "
set Type(pore.toroidal) Group
set Title(pore.toroidal.r0) "Radius(R0): "
set Type(pore.toroidal.r0) Entry
set pore_toroidal_r0   "     0.0"
set Title(pore.toroidal.k0) "Curvature(K0): "
set Type(pore.toroidal.k0) Entry
set pore_toroidal_k0   "     0.0"
set Title(pore.toroidal.ih) "Inhomogenity: "
set Description(pore.toroidal.ih) "The ratio of charge density in the pore center over in the pore rim. Only effective for toroidal pore. 1-> homogenous."
set Type(pore.toroidal.ih) Entry
set pore_toroidal_ih   "     1.0"

set Title(pore.cylindrical) "Cylindrical Pore: "
set Type(pore.cylindrical) Group
set Title(pore.cylindrical.r) "Radius(R): "
set Type(pore.cylindrical.r) Entry
set pore_cylindrical_r "     0.0"

#Form jobs
set Title(jobs) "Job"
set Description(jobs) "Control jobs"
set Child(jobs.list) { title jobstatus}
set Title(jobs.list) "Current Running:"
set Type(jobs.list) Group
set Title(jobs.list.title) "ID Path                                                                    Progress"
set Type(jobs.list.title) Label
set Title(jobs.list.jobstatus) "ID path progress"
set Type(jobs.list.jobstatus) List 
set Format(jobs.list.jobstatus) { :hover { background red } }



# example for test List 
#dict set jobs_list_jobstatus  1 {path status} 
#set Format(jobs.list.jobstatus.1) {width 300}

#set Title(jobs.list.jobstatus.1.path) [pwd]
#set Type(jobs.list.jobstatus.1.path) Label 

#set Title(jobs.list.jobstatus.1.status) ""
#set Type(jobs.list.jobstatus.1.status) Status(Progress:7)
#set Format(jobs.list.jobstatus.1.status) {width 70 style dots }
#set jobs_list_jobstatus_1_status Progress(1)

#set Progress(1) 3

set Title(jobs.control) ""
set Type(jobs.control) Group
set Child(jobs.control) {{maxrunning add delete}}
set Description(jobs.control) "Add or delete jobs"
set Title(jobs.control.maxrunning) "Max Job: "
set Type(jobs.control.maxrunning) Entry
set jobs_control_maxrunning 4
set Title(jobs.control.add) "Add New Job"
set Type(jobs.control.add) Button
set jobs_control_add {     
    if ![file exists $workDir] {
       set reply [tk_dialog .createNewDir "Create New Dir?" "$workDir is not there! Do you want to create one? If not, no job will be created." \
       questhead 0 Yes No]
       if { $reply == 0 } {
         if ![catch { package require tkMD}] {
           Path::mk_path $workDir
           cd $workDir
           AddJob "[genJob]"
         } else {
            tk_messageBox -message "tkMD do not exists for this system!Will not add" -type ok
         }
       }
       return 
    }
    cd $workDir
    AddJob "[genJob]"
   }
set Title(jobs.control.delete) "Delete"
set Type(jobs.control.delete) Button
set jobs_control_delete [list DelJob ]


#Form Help
set Title(help.variables) "Variables"
set Type(help.variables) Group

